package org.suyafei.service;

import org.suyafei.controller.request.TrafficPageRequest;
import org.suyafei.controller.request.UseTrafficRequest;
import org.suyafei.model.EventMessage;
import org.suyafei.utils.JsonData;
import org.suyafei.vo.TrafficVO;

import java.util.List;
import java.util.Map;

/**
 * @author 宿某人
 * @Date: 2022/03/11/16:16
 * @Description:
 */
public interface TrafficService {
    /**
     * 处理流量包消息
     * @param eventMessage
     */
    void handleTrafficMessage(EventMessage eventMessage);

    /**
     * 分页查询有效的流量包
     * @param request
     * @return
     */
    Map<String, Object> pageAvailable(TrafficPageRequest request);

    /**
     * 查询流量包详情
     * @param trafficId
     * @return
     */
    TrafficVO detail(Long trafficId);

    /**
     * 删除过期流量包
     * @return
     */
    boolean deleteExpiredTraffic();


    /**
     * 扣减流量包
     * @param request
     * @return
     */
    JsonData reduce(UseTrafficRequest request);
}
